Skip to content

chore(promql_utilities): relocate Statistic/KeyByLabelNames to asap_types - #397

Merged
zzylol merged 1 commit into
mainfrom
chore/relocate-statistic-keybylabelnames
Jul 20, 2026
Merged

zzylol merged 1 commit into
mainfrom
chore/relocate-statistic-keybylabelnames

Conversation

@zzylol

@zzylol zzylol commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Stage 3 of the promql_utilities retirement plan (see Stage 1: ASAPController#141, Stage 2: #396).

  • QueryResultType moves into data_plane::query_engines::query_result (inlined; it had no asap_types dependency, so this matches the original plan).
  • Statistic and KeyByLabelNames move into asap_types, not data_plane as the original design doc said. Corrected mid-stage after checking Cargo.toml: the dependency graph is promql_utilities ← asap_types ← data_plane, and both types are already load-bearing inside asap_types itself (compatible_agg_types, QueryRequirements, capability_matching, AggregationConfig::grouping_labels, PolicyFingerprint, PolicyRegistry). Moving them into data_plane (which sits above asap_types) would have created an unbuildable dependency cycle.
  • Every downstream import site (48 files) repointed to asap_types::{Statistic, KeyByLabelNames}, or crate:: where the call site is itself inside the asap_types crate.

No behavior change — both types moved verbatim, including their debug!() tracing calls.

Test plan

  • cargo build --workspace — clean
  • cargo test -p promql_utilities -p asap_types -p control_plane — 828 passed, 1 pre-existing unrelated failure (invalid_sketch_type_override_falls_back_to_default)
  • cargo check --workspace --tests — clean (confirms all 48 touched import sites, including test/bench files, compile)
  • cargo test -p data_plane --lib — 881 passed

🤖 Generated with Claude Code

…ypes

Stage 3 of the promql_utilities retirement. QueryResultType moves into
data_plane::query_engines::query_result (no asap_types dependency
there); Statistic and KeyByLabelNames both move into asap_types
instead of data_plane as originally planned in the design doc — the
dependency graph is promql_utilities <- asap_types <- data_plane, and
both types are load-bearing inside asap_types itself
(compatible_agg_types, QueryRequirements, capability_matching,
AggregationConfig::grouping_labels, PolicyFingerprint,
PolicyRegistry), so moving them into data_plane (which sits above
asap_types) would create an unbuildable cycle.

No behavior change: both types move verbatim, including their
debug!() tracing calls. Every downstream import site (48 files) is
repointed to asap_types::{Statistic, KeyByLabelNames} (or crate::
where the site is itself inside the asap_types crate).

- cargo build --workspace: clean
- cargo test -p promql_utilities -p asap_types -p control_plane:
  828 passed, 1 pre-existing unrelated failure
  (invalid_sketch_type_override_falls_back_to_default)
- cargo check --workspace --tests: clean
- cargo test -p data_plane --lib: 881 passed

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant